﻿using UnityEngine;
using System.Collections;

public class BGManager : MonoBehaviour {
	
	public Transform[] backgrounds;
	public string TAGID;
	//public GameObject tK;
	
	// Use this for initialization
	void Start () {
		//GameObject.Instantiate(tK)
	}
	
	// Update is called once per frame
	void Update () {
		Vector3 tmpPos = backgrounds[0].localPosition;
		tmpPos.x = -transform.position.x / 2;
		tmpPos.y = -transform.position.y - 1.9f;
		backgrounds[0].localPosition = tmpPos;
		
		tmpPos = backgrounds[1].localPosition;
		tmpPos.x = -transform.position.x / 6;
		tmpPos.y = -transform.position.y / 4 - 2.5f;
		backgrounds[1].localPosition = tmpPos;
		
		tmpPos = backgrounds[2].localPosition;
		tmpPos.x = -transform.position.x / 10;
		tmpPos.y = -transform.position.y / 6 + 5.0f;
		backgrounds[2].localPosition = tmpPos;
	}
}
